3D Graphics Programming with QuickDraw 3D 1.5.4
Previous | QD3D Book | Overview | Chapter Contents | Next |
A trigrid is a rectangular grid composed of triangular facets. The triangulation should be serpentine (that is, quadrilaterals are divided into triangles in an alternating fashion) to reduce shading artifacts when using Gouraud or Phong shading. Figure 26 shows a trigrid.
The entire trigrid can have a set of attributes. You may specify an array of attributes that apply to each facet of the trigrid. In this way, for example, you can give each facet of the trigrid a different color. In addition, any or all of the vertices can have a set of attributes.
A trigrid is defined by the TQ3TriGridData data type. See "Creating and Editing Trigrids" for a description of the routines you can use to create and edit trigrids.
typedef struct TQ3TriGridData {
unsigned long numRows;
unsigned long numColumns;
TQ3Vertex3D *vertices;
TQ3AttributeSet *facetAttributeSet;
TQ3AttributeSet triGridAttributeSet;
} TQ3TriGridData;
Previous | QD3D Book | Overview | Chapter Contents | Next |